package com.example.covid19.mapper;

import com.example.covid19.common.Dto.goodsDto;
import com.example.covid19.common.Dto.monDto;
import com.example.covid19.entity.Monnaie;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author BaiZhengChun
 * @since 2022-11-30
 */
public interface MonnaieMapper extends BaseMapper<Monnaie> {
    @Select("SELECT\n" +
            " monnaie.quantite, " +
            " monnaie.sid,  " +
            " monnaie.jour, " +
            " gstock.stock,  " +
            " gstock.brand,  " +
            " gstock.type,  " +
            " gstock.quality,  " +
            " gstock.price,  " +
            " gstock.producing_area,  " +
            " gstock.goodsname,  " +
            " gstock.ssid,  " +
            " gstock.isup,  " +
            " manufacturer.upname " +
            "FROM " +
            " monnaie " +
            " INNER JOIN " +
            " gstock " +
            " ON  " +
            " monnaie.sid = gstock.ssid " +
            " INNER JOIN " +
            " manufacturer " +
            " ON  " +
            " gstock.isup = manufacturer.isup " +
            "WHERE " +
            " monnaie.sid = gstock.ssid AND " +
            " gstock.isup = manufacturer.isup")
    List<monDto> moninfo();
    @Select("SELECT\n" +
            " monnaie.quantite, " +
            " monnaie.sid,  " +
            " monnaie.jour, " +
            " gstock.stock,  " +
            " gstock.brand,  " +
            " gstock.type,  " +
            " gstock.quality,  " +
            " gstock.price,  " +
            " gstock.producing_area,  " +
            " gstock.goodsname,  " +
            " gstock.ssid,  " +
            " gstock.isup,  " +
            " manufacturer.upname " +
            "FROM " +
            " monnaie " +
            " INNER JOIN " +
            " gstock " +
            " ON  " +
            " monnaie.sid = gstock.ssid " +
            " INNER JOIN " +
            " manufacturer " +
            " ON  " +
            " gstock.isup = manufacturer.isup " +
            "WHERE " +
            " monnaie.sid = gstock.ssid AND " +
            " gstock.isup = manufacturer.isup"+
            " LIMIT #{pageNo}, #{pagesize} "
    )
    List<monDto> moninfo2(@Param("pageNo")Integer pageNo,@Param("pagesize")Integer pagesize);

}
